package router;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 
 * @author zgy
 *
 */
@Controller
@RequestMapping(value = "wxMessageRouter")
public class WxMessageRouter {

	private static Logger logger = Logger.getLogger(WxMessageRouter.class);

	@RequestMapping
	public String router(@RequestParam("funcID") String funcID) {
		if(funcID.equals("1001")) {
			logger.info("[wxMessageRouter]" + funcID + " 通知用户取件");
			return "forward:wxMessage/getPP2U";
			//return "forward:wxMessage/myError";
		} else if(funcID.equals("1002")) {
			logger.info("[wxMessageRouter]" + funcID + " 用户取件成功通知");
			return "forward:wxMessage/getedP2U";
			//return "forward:wxMessage/myError";
		} else if(funcID.equals("1003")) {
			logger.info("[wxMessageRouter]" + funcID + " 通知用户取问题件被取走");
			return "forward:wxMessage/getedPP2U";
			//return "forward:wxMessage/myError";
		} else if(funcID.equals("1004")) {
			logger.info("[wxMessageRouter]" + funcID + " 通知快递员取问题件");
			return "forward:wxMessage/getPP2C";
			//return "forward:wxMessage/myError";
		}else if(funcID.equals("1005")) {
			logger.info("[wxMessageRouter]" + funcID + " 洗衣状态改变通知");
			return "forward:wxMessage/xyStatus";
			//return "forward:wxMessage/myError";
		}else if(funcID.equals("1006")) {
			logger.info("[wxMessageRouter]" + funcID + " 早餐提取通知");
			return "forward:wxMessage/getZC";
			//return "forward:wxMessage/myError";
		}else if(funcID.equals("1007")) {
			logger.info("[wxMessageRouter]" + funcID + " 早餐配送通知");
			return "forward:wxMessage/zcSend";
			//return "forward:wxMessage/myError";
		}else {
			logger.info("no such funcID existed");
			return "forward:error";
		}
	}
}